using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._MultidimensionTools._NetCDF
{
    /// <summary>
    /// <para>Make NetCDF Feature Layer</para>
    /// <para>Makes a feature layer from a netCDF file.</para>
    /// <para>根据 netCDF 文件创建要素图层。</para>
    /// </summary>    
    [DisplayName("Make NetCDF Feature Layer")]
    public class MakeNetCDFFeatureLayer : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MakeNetCDFFeatureLayer()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_netCDF_file">
        /// <para>Input netCDF File</para>
        /// <para>The input netCDF file.</para>
        /// <para>输入 netCDF 文件。</para>
        /// </param>
        /// <param name="_variable">
        /// <para>Variables</para>
        /// <para>The netCDF variable, or variables, that will be added as fields in the feature attribute table.</para>
        /// <para>将作为字段添加到要素属性表中的一个或多个 netCDF 变量。</para>
        /// </param>
        /// <param name="_x_variable">
        /// <para>X Variable</para>
        /// <para>A netCDF coordinate variable used to define the x, or longitude, coordinates of the output layer.</para>
        /// <para>netCDF 坐标变量，用于定义输出图层的 x 或经度坐标。</para>
        /// </param>
        /// <param name="_y_variable">
        /// <para>Y Variable</para>
        /// <para>A netCDF coordinate variable used to define the y, or latitude, coordinates of the output layer.</para>
        /// <para>用于定义输出图层的 y 或纬度坐标的 netCDF 坐标变量。</para>
        /// </param>
        /// <param name="_out_feature_layer">
        /// <para>Output Feature Layer</para>
        /// <para>The name of the output feature layer.</para>
        /// <para>输出要素图层的名称。</para>
        /// </param>
        public MakeNetCDFFeatureLayer(object _in_netCDF_file, List<object> _variable, object _x_variable, object _y_variable, object _out_feature_layer)
        {
            this._in_netCDF_file = _in_netCDF_file;
            this._variable = _variable;
            this._x_variable = _x_variable;
            this._y_variable = _y_variable;
            this._out_feature_layer = _out_feature_layer;
        }
        public override string ToolboxName => "Multidimension Tools";

        public override string ToolName => "Make NetCDF Feature Layer";

        public override string CallName => "md.MakeNetCDFFeatureLayer";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_netCDF_file, _variable, _x_variable, _y_variable, _out_feature_layer, _row_dimension, _z_variable, _m_variable, _dimension_values, _value_selection_method.GetGPValue()];

        /// <summary>
        /// <para>Input netCDF File</para>
        /// <para>The input netCDF file.</para>
        /// <para>输入 netCDF 文件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input netCDF File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_netCDF_file { get; set; }


        /// <summary>
        /// <para>Variables</para>
        /// <para>The netCDF variable, or variables, that will be added as fields in the feature attribute table.</para>
        /// <para>将作为字段添加到要素属性表中的一个或多个 netCDF 变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Variables")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _variable { get; set; }


        /// <summary>
        /// <para>X Variable</para>
        /// <para>A netCDF coordinate variable used to define the x, or longitude, coordinates of the output layer.</para>
        /// <para>netCDF 坐标变量，用于定义输出图层的 x 或经度坐标。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("X Variable")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _x_variable { get; set; }


        /// <summary>
        /// <para>Y Variable</para>
        /// <para>A netCDF coordinate variable used to define the y, or latitude, coordinates of the output layer.</para>
        /// <para>用于定义输出图层的 y 或纬度坐标的 netCDF 坐标变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Y Variable")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _y_variable { get; set; }


        /// <summary>
        /// <para>Output Feature Layer</para>
        /// <para>The name of the output feature layer.</para>
        /// <para>输出要素图层的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_layer { get; set; }


        /// <summary>
        /// <para>Row Dimensions</para>
        /// <para><xdoc>
        ///   <para>The netCDF dimension, or dimensions, used to create features with unique values in the feature layer. The dimension or dimensions set here determine the number of features in the feature layer and the fields that will be presented in the feature layer's attribute table.</para>
        ///   <para>For instance, if StationID is a dimension in the netCDF file and has 10 values, by setting StationID as the dimension to use, 10 features will be created (10 rows will be created in the feature layer's attribute table). If StationID and time are used, and there are 3 time slices, 30 features will be created (30 rows will be created in the feature layer's attribute table). If you will be animating the netCDF feature layer, it is recommended, for efficiency reasons, to not set time as a row dimension. Time will still be available as a dimension that you can set to animate through, but the attribute table will not store this information.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于在要素图层中创建具有唯一值的要素的一个或多个 netCDF 维度。此处设置的一个或多个维度决定了要素图层中的要素数量以及将在要素图层属性表中显示的字段。</para>
        ///   <para>例如，如果 StationID 是 netCDF 文件中的维度且具有 10 个值，则通过将 StationID 设置为要使用的维度，将创建 10 个要素（将在要素图层的属性表中创建 10 行）。如果使用 StationID 和 time，并且有 3 个时间片，则将创建 30 个要素（将在要素图层的属性表中创建 30 行）。如果要对 netCDF 要素图层进行动画处理，出于效率原因，建议不要将时间设置为行维度。时间仍将作为维度提供，您可以将其设置为动画处理，但属性表不会存储此信息。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Row Dimensions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _row_dimension { get; set; } = null;


        /// <summary>
        /// <para>Z Variable</para>
        /// <para>A netCDF variable used to specify elevation values (z-values) for features.</para>
        /// <para>用于指定要素的高程值（z 值）的 netCDF 变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z Variable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _z_variable { get; set; } = null;


        /// <summary>
        /// <para>M Variable</para>
        /// <para>A netCDF variable used to specify linear measurement values (m-values) for features.</para>
        /// <para>用于指定要素的线性测量值（m 值）的 netCDF 变量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("M Variable")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _m_variable { get; set; } = null;


        /// <summary>
        /// <para>Dimension Values</para>
        /// <para><xdoc>
        ///   <para>The value (such as 01/30/05) of the dimension (such as Time) or dimensions to use when displaying the variable in the output layer. By default, the first value of the dimension or dimensions will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Dimension—A netCDF dimension.</bullet_item><para/>
        ///     <bullet_item>Value—The dimension value to use.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在输出图层中显示变量时要使用的维度（例如 Time）的值（例如 01/30/05）。默认情况下，将使用一个或多个维度的第一个值。</para>
        ///   <bulletList>
        ///     <bullet_item>维度 - netCDF 维度。</bullet_item><para/>
        ///     <bullet_item>值 - 要使用的维度值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dimension Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _dimension_values { get; set; } = null;


        /// <summary>
        /// <para>Value Selection Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the dimension value selection method that will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>By value—The input value is matched with the actual dimension value.</bullet_item><para/>
        ///     <bullet_item>By index—The input value is matched with the position or index of a dimension value. The index is 0 based; that is, the position starts at 0.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将使用的尺寸值选择方法。</para>
        ///   <bulletList>
        ///     <bullet_item>按值 - 输入值与实际尺寸值匹配。</bullet_item><para/>
        ///     <bullet_item>按索引 - 输入值与维度值的位置或索引匹配。该指数以 0 为基础;也就是说，仓位从 0 开始。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value Selection Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _value_selection_method_value _value_selection_method { get; set; } = _value_selection_method_value._BY_VALUE;

        public enum _value_selection_method_value
        {
            /// <summary>
            /// <para>By index</para>
            /// <para>By index—The input value is matched with the position or index of a dimension value. The index is 0 based; that is, the position starts at 0.</para>
            /// <para>按索引 - 输入值与维度值的位置或索引匹配。该指数以 0 为基础;也就是说，仓位从 0 开始。</para>
            /// </summary>
            [Description("By index")]
            [GPEnumValue("BY_INDEX")]
            _BY_INDEX,

            /// <summary>
            /// <para>By value</para>
            /// <para>By value—The input value is matched with the actual dimension value.</para>
            /// <para>按值 - 输入值与实际尺寸值匹配。</para>
            /// </summary>
            [Description("By value")]
            [GPEnumValue("BY_VALUE")]
            _BY_VALUE,

        }

        public MakeNetCDFFeatureLayer SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}